﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void ContinueButton_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/SelfInfo.aspx");
    }
    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {
        string adname = CreateUserWizard1.UserName;
        string adpsd = CreateUserWizard1.Password;
        string ademail = CreateUserWizard1.Email;
        string adqst = CreateUserWizard1.Question;
        string adans = CreateUserWizard1.Answer;
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = "Data Source=CUTYLAW;Initial Catalog=graduate_manage;Integrated Security=True";

        try
        {
            conn.Open();
            SqlCommand adcom = new SqlCommand();
            adcom.Connection = conn;
            adcom.CommandText = "insert into admin_pswd(admin_id,admin_email,admin_password,admin_question,admin_answer) values (@adname,@ademail,@adpsd,@adqst,@adans)";
            string tex = adcom.CommandText;
            
            adcom.ExecuteReader(); 
        }
        catch (Exception ex)
        {
            Response.Redirect("~/testChart.aspx",true);
        }
        finally
        {
            conn.Close();
        }
        
    }
}